<?php



namespace app\meetyou\controller;

use library\Controller;

/**
 * 众筹参数配置
 * Class Config
 * @package app\meetyou\controller
 */
class Config extends Controller
{

    /**
     * 众筹参数配置
     * @auth true
     * @menu true
     * @throws \think\Exception
     * @throws \think\exception\PDOException
     */
    public function index()
    {
        $this->title = '众筹参数配置';
        $this->applyCsrfToken('save');
        $this->fetch();
    }

    /**
     * 保存众筹参数
     * @auth true
     * @throws \think\Exception
     * @throws \think\exception\PDOException
     */
    public function save()
    {
        if ($this->request->isPost()) {
            $this->applyCsrfToken('save');
            foreach ($this->request->post() as $k => $v) sysconf($k, $v);
            $this->success('众筹配置保存成功！');
        }
    }

}
